home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / eventq.exe / README < prev    next >
Text File  |  1991-07-13  |  2KB  |  33 lines

  1. In a standard Turbo Vision application, the TApplication event queue is only
  2. one event deep. That is, you can only PutEvent a single event; any subsequent
  3. PutEvent before the occurrence of a GetEvent will overwrite the original
  4. event. The EVENTQ unit implements an event queue, so that you can stuff a
  5. number of simulated keystrokes into a Turbo Vision application. Two possible
  6. applications for this technique are:
  7.  
  8. 1) Normally, after a dialog box closes, the Turbo Vision main menu returns to
  9. its inactive state, with none of the menus pulled down. However, if you have
  10. implemented a multi-level menu, it may make more sense for the menu to remain
  11. in a pulled-down state after a dialog box is closed. Thus, if you are three
  12. levels deep in a menu, and you issue a command on that menu, you can, as the
  13. last part of the processing of that command, put the appropriate keystrokes
  14. into the event queue to pull the menu down to the same location. For example,
  15. in the Turbo Pascal IDE, when the Options/Environment/Preferences dialog box
  16. closes, all of the pulled-down menus are gone. It might be appropriate at the
  17. end of the Preferences dialog box processing to insert an Alt-O and an E into
  18. the event queue, so that the menus are restored to the same state that
  19. existed immediately before the Preferences command was issued.
  20.  
  21. 2) You can use the ability to put simulated keystrokes into the event queue
  22. to run a Turbo Vision program from a script file (as a self-running demo, for
  23. example). The SCRDEMO.PAS file contains code which, in conjunction with the
  24. TVDEMO.PAS program that comes with Turbo Pascal, demonstrates this technique.
  25. Instructions for using SCRDEMO are contained in the file. SCRIPT.SCR is the
  26. script file used by SCRDEMO; it contains a description of the script command
  27. language.
  28.  
  29. Any comments, questions, suggestions, etc. should be directed to:
  30.  
  31.   Steve Schafer
  32.   71121,1771
  33.